<template>
  <div>
    <input
      type="text"
      v-model='qqq'
    >
    <button
      class='btn'
      @click='f'
    >
      <slot></slot>
    </button>
  </div>
</template>
<script>
// @ is an alias to /src
export default {
  name: "XXX",
  data() {
    return {
      qqq: 1000,
    };
  },
  beforeUpdate() {
    console.log("子beforeUpdate");
  },
  updated() {
    console.log("子updated");
  },
  methods: {
    f(e) {
      this.$emit("click", e);
    },
  },
};
</script>
<style lang="less" scope>
.btn {
  background-color: red;
  color: #fff;
}
</style>